﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using PMS.Web.Models;

namespace PMS.Web.Controllers
{
    public class BaseController : Controller
    {
        protected UserIdentity UserIdentity
        {
            get
            {
                var userIdentity = new UserIdentity();

                userIdentity.UserId = 1;
                userIdentity.Title = "项目经理";
                userIdentity.Company = "嘉禾公司";
                userIdentity.Avatar = "";
                userIdentity.Name = "余老师";

                //userIdentity.UserId = Convert.ToInt16(User.Claims.FirstOrDefault(b => b.Type == "sub").Value);
                //userIdentity.Title = User.Claims.FirstOrDefault(b => b.Type == "title").Value;
                //userIdentity.Company = User.Claims.FirstOrDefault(b => b.Type == "company").Value;
                //userIdentity.Avatar = User.Claims.FirstOrDefault(b => b.Type == "avatar").Value;
                //userIdentity.Name = User.Claims.FirstOrDefault(b => b.Type == "name").Value;
                return userIdentity;
            }
        }
    }
}